<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  
</head>
<body>
  <div id="app">
    <ul>
      <li v-for="fruit in arr">
        {{ fruit }}
      </li>
    </ul>
    <hr>
    <!-- 循环中下标 -->
    <ul>
      <li v-for="(fruit, index) in arr">
        {{ fruit }}
        ->
        {{ index }}
      </li>
    </ul>
    <hr>
    <!-- 循环对象 -->
    <ul>
      <li v-for="(el, key, index) in json">
        {{ el }}
        =>
        {{ key }}
        =>
        {{ index }}
      </li>
    </ul>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        arr: ['茄子','苹果','梨子','榴莲'],
        json: {
          a: 10,
          b: 20,
          c: 30
        }
      }
    })
  </script>
</body>
</html>


